using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for BaseZoneMenu
/// </summary>
public class BaseZoneMenu : BaseUserControl
{
    public BaseZoneMenu()
    {
    }

    protected void SetQuerystring(HyperLink lnk, int id, string key)
    {
        string spacer = "&";
        if (lnk.NavigateUrl.EndsWith(".aspx"))
            spacer = "?";
        lnk.NavigateUrl = string.Concat(lnk.NavigateUrl, spacer, key, "=", id);
    }


    protected void SetIfSelected(HyperLink lnk)
    {
        string url = lnk.NavigateUrl;
        if (url.IndexOf("?") >= 0)
        {
            url = url.Substring(0, url.IndexOf("?"));
        }
        if (Page.ResolveUrl(url).ToLower() == Page.Request.Url.LocalPath.ToLower())
        {
            lnk.CssClass = string.Concat(lnk.CssClass, " selected");
            lnk.CssClass = lnk.CssClass.Trim();
        }
    }

}
